<?php
namespace Modules\Admin\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Admin\Entities\Module;
use Modules\Admin\Http\Requests\ModuleRequest;
use Modules\Admin\Service\ModuleService;

class ModuleController extends Controller
{
    //显示列表
    public function index()
    {
        $data = Module::paginate(10);
        return view('admin::module.index', compact('data'));
    }

   public function updateCache(ModuleService $moduleService){
		$moduleService->updateCache ();
		session ()->flash ('success','模块更新成功');
		return back ();
   }
   public function setDefaultModule(Module $module){
		$module->setDefault ();
		session ()->flash ('success','设置成功');
		return back ();
   }
}
